﻿<Window x:Class="RealEstateBrowser.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="500" Width="900">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="100"/>
            <ColumnDefinition Width="100"/>
            <ColumnDefinition Width="150*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="0,7*"/>
            <RowDefinition Height="0,3*"/>
        </Grid.RowDefinitions>
        
        <ListView ItemsSource="{Binding Towns}" SelectedItem="{Binding CurrentTown}">
            <ListView.ItemTemplate>
                <DataTemplate>
                    <StackPanel>
                        <TextBlock Text="{Binding TownName}"></TextBlock>
                    </StackPanel>
                </DataTemplate>
            </ListView.ItemTemplate>
        </ListView>
        <ListView Grid.Column="1" ItemsSource="{Binding Districts}"
                  SelectedItem="{Binding CurrentDistrict}">
            <ListView.ItemTemplate>
                <DataTemplate>
                    <StackPanel>
                        <TextBlock Text="{Binding DistrictName}"></TextBlock>
                    </StackPanel>
                </DataTemplate>
            </ListView.ItemTemplate>
        </ListView>
        
        <ListView Grid.Column="2" ItemsSource="{Binding Offers}"
                  SelectedItem="{Binding CurrentOffer}">
            <ListView.ItemTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="ID:" FontWeight="Bold"/>
                        <TextBlock Text="{Binding Offer.OfferID}"></TextBlock>
                        <TextBlock Text="   "/>
                        <TextBlock Text="{Binding Offer.PublishDate}"/>
                        <TextBlock Text="{Binding Offer.Price}"/>
                        <Button x:Name="ButtonDetails" Content="Details" Click="ButtonDetails_Click"></Button>
                    </StackPanel>
                </DataTemplate>
            </ListView.ItemTemplate>
        </ListView>
        
        <Button x:Name="ButtonAdvancedSearch" Content="Advanced search" Grid.Row="1" Grid.Column="0" Height="50"
                Click="ButtonAdvancedSearch_Click"/>
    </Grid>
</Window>
